package com.ftg.learn.util;

import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author kangjx
 * @createTime 2022/10/26
 */
@Configuration
public class PlusPagenation {

    @Bean
    public MybatisPlusInterceptor abc() {
        PaginationInnerInterceptor page = new PaginationInnerInterceptor();
        MybatisPlusInterceptor mybatisPlusInterceptor = new MybatisPlusInterceptor();
        mybatisPlusInterceptor.addInnerInterceptor(page);
        page.setDbType(DbType.MYSQL);
        return mybatisPlusInterceptor;
    }
}

